<div id="mws-container" class="clearfix">
    <div class="container">
        <div class="mws-panel grid_8">
            <div class="mws-panel-header"> <span class="mws-i-24 i-table-1"><?php if (isset($type) and $type) {
    echo $type;
} else { ?>Orders <?php } ?>
                    - Management</span> 
            </div>
            <div class="mws-panel-body">
                <div class="dataTables_wrapper">
                    <table class="mws-datatable-fn mws-table">
                        <thead>
                            <tr>
                                <th class="sorting_asc" rowspan="1" colspan="1" style="width: 141px;">By Customer</th>
                                <th class="sorting" rowspan="1" colspan="1" style="width: 150px;">Tracking OrderID</th>
                                <th class="sorting" rowspan="1" colspan="1" style="width: 239px;">Order Total Amount </th>
                                <th class="sorting" rowspan="1" colspan="1" style="width: 150px;">WonderE Profit </th>
                                <th class="sorting" rowspan="1" colspan="1" style="width: 91px;">Payment Status</th>
                                <th class="sorting" rowspan="1" colspan="1" style="width: 91px;">Payment Method</th>
                                <th class="sorting" rowspan="1" colspan="1" style="width: 91px;">Order Date</th>
                                <th class="sorting" rowspan="1" colspan="1" style="width: 91px;">Action</th>
                            </tr>
                        </thead>
                        <?php
                        if (isset($Order_list) and ($Order_list)):
                            //pr($products);
                            //exit;
                            ?>
                            <tbody>
                                <?php
                                $x = 0;
                                foreach ($Order_list as $Order) {
                                    if ($x % 2 == 0) {
                                        $class = "odd";
                                    } else {
                                        $class = "even";
                                    }
                                    //pr($Order);
                                    //exit;
                                    ?>
                                    <tr class="gradeA <?php echo $class; ?>">
                                        <td class=" sorting_1"><?php echo $Order['User']['name']; ?></td>
                                        <td class=" sorting_1">
                                            <?php echo $html->link($Order['Order']['tracking_id'], array('action' => 'admin_order_details', 'order_id' => $Order['Order']['tracking_id'])); ?>
                                        </td>
                                        <td class=" sorting_1">$<?php echo $Order['Order']['total_price']; ?></td>
                                        <td class=" sorting_1">$<?php echo $Order['Order']['wondere_price']; ?></td>  
                                        <td class=" sorting_1"><?php if ($Order['Order']['payment_status'] == 0) {
                                        echo "UnPaid";
                                    } else {
                                        echo "Paid";
                                    } ?></td>
                                        <td class=" sorting_1"><?php echo $Order['Order']['payment_method']; ?></td> 
                                        <td class=" sorting_1" style="padding:0px;padding-left:10px;"><?php echo $Order['Order']['created']; ?></td>
                                        <td class="center" style="padding:0px; padding-left:10px;">
                                            <a href="#">Edit</a>
                                            <?php
                                            // echo $html->link("Edit", 
                                            // array('action'=>'admin_edit_order', 
                                            //$Order['Order']['tracking_id']),
                                            // array('escape'=>false));  
                                            ?>
                                            <?php
                                            echo $html->link('Delete', array('controller' => 'Setups', 'action' => 'admin_delete_by_id',
                                                'Order', $Order['Order']['id'], 'admin_orders', $type), array('escape' => false, 'id' => 'alink'), 'Are you sure?');
                                            ?>
                                            <?php
                                            if (isset($Order['Order']['PayKey']) and ($Order['Order']['PayKey']) and !empty($Order['Order']['PayKey'])) {
                                                echo $html->link('Paid', array('controller' => 'Setups', 'action' => 'admin_order_pay', $Order['Order']['tracking_id'], $Order['Order']['PayKey']), array('escape' => false, 'id' => 'alink'));
                                            } else {
                                                echo $html->link('Paid', array('controller' => 'Setups', 'action' => 'admin_order_pay', $Order['Order']['tracking_id']), array('escape' => false, 'id' => 'alink'));
                                            }
                                            ?>
                                        </td>
                                    </tr>
                                            <?php $x++;
                                        } ?>
                            </tbody>
                            <?php endif; ?>
                    </table>
                    <!--          <div class="dataTables_info">Showing 1 to 10 of 57 entries</div>
                  <div class="dataTables_paginate paging_full_numbers">
                      <span class="first paginate_button paginate_button_disabled">First</span>
                          <span class="previous paginate_button paginate_button_disabled">Previous</span>
                          <span><span class="paginate_active">1</span>
                          <span class="paginate_button">2</span>
                          <span class="paginate_button">3</span>
                          <span class="paginate_button">4</span>
                          <span class="paginate_button">5</span>
                      </span>
                      <span class="next paginate_button">Next</span>
                      <span class="last paginate_button">Last</span>
                  </div>-->
                </div>
            </div>
        </div>
    </div>
</div>
